package com.hanma.app.Server;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;

import com.hanma.app.beans.Persion;
import com.hanma.app.beans.PersionManager;

import java.util.ArrayList;
import java.util.List;

public class ServierService extends Service {
    List<Persion> persions;
    private IBinder mBinder = new PersionManager.Stub() {
        @Override
        public List<Persion> getPersion() throws RemoteException {
            return  persions;
        }

        @Override
        public void addPersion(Persion persion) throws RemoteException {
            persion.setName(persion.getName()+":modified");
            persions.add(persion);

        }

        @Override
        public void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, double aDouble, String aString) throws RemoteException {

        }
    };
    @Override
    public IBinder onBind(Intent intent) {
        persions = new ArrayList<>();
        return mBinder;
    }
}
